bug fix for collapse options, accessing localStorage through $window for better encapsulation