changed login logout functionatliy