Getting /setlocation to function