some error handling for bad start and end locations