Fixed incorrect call
Made folder deletion more robust