fixed nullpointer exception, if location wasn't available yet