Implemented exit condition