Fixed error when user loggs out