fixed quitting issue