update logout function