added assert_location and updated assert_end_location to use the new function