added the location mismatch detection