locationToJSON fixed