bugfix: query updated for mysql