fixed logic error for purging cache on logout