fixed calling of logout function