update logout function.