Added communication with database.