some changes to exit behavior