Updated PDO to handle lost mysql connections