fixed the Quit function of department