Changed the database connection to use pool