fixing sqlcriteria