Fixed the exit method