some fix in sql command