fix bug after user update or create leaves fail