Changed exit condition