fix except on exit loop