added logout functionality