- fixed a bug with inserting reference data into db
- fixed a bug where edit for reference materials were not updating the db records properly