lockService, fixing bad SQL Query