Bugfix for mysql database