fix next tick bug