fix already existing file case and folder creation