Fix bug with mysql connection