added prepare to the queries

Added prepare to the queries.