Updated script to check child directories when comparing modified date