added stay constraints and fied up tests