new quit condition implemented and working