fixed logout button, logic should come out of template