constraints: fix selecting the required constraint