fixing PDO error in get all function call