Stop moving ahead if constraint fails

Welcome to the community, @bbmahapatra! Maybe you could use this approach as discussed previously: