fix forward loop