prevent similar problems in location.t, perhaps this should be generalized?