fixed exit on complete bug