hook into database