made some changes from localstorage towards mongo