Fixed get function for locations