fix SQL query syntax, fixes #143