removed a bug when yielding