Updated model and pdo model to output debug queries