fixes #2791 new parent folder caches are not being flushed

Fixed and pushed the code for review,please check it.