fixed vars in logout function