fixed no long or lat bug and sql query