merged login functionality
added logout functionality