finish the location and status function