updated to use PDO class