Revert ordering
Try comment out "not a directory" condition