communicates with database.