added logout functionality using sessions