Escapping sql query
Bug fix