swapped the order of the passes to correct broken behavior