fixed bug with Mysql. Thanks @Adi for reporting.