update query to be postgre compliant
updated gem version