- [modified] way saving and loading from database is done