fix function of exit()