getting location to write to databse