local storage testing
fixed logic issues for localStorage