Fix core location function