save attributes to database. TODO: load from database