changed how app state works so as not to create new collections unnecessarily, fixed bugs