fix problem with single quotes on query