Fixed bug with mysql connection