perform a couple of checks on the location to prevent escaping.