now fully operable with database