Removed unused code
Fixed problems login out