fix location check