replaced exec rmdir calls with native php code