correct PDO query exception handling