Fixed a bug with MySQL connection