working on saving to database