added logout function