fix onleave