correct exception handler range checks