added login logout function