folder remove logic