exit with proper status