Storing location in database