Add logout feature
Fixed redirect bug in login