fixes bug in forEachInReverse: never visited first element