modified for inventory page to use databases