fix null pointer problem with getting latest cached location