Added interaction with database