Logic of working with PDO: fix