Updated if/else

Changed in-else to test newDir variable