fixing the exit