Fixed execution order

It would make files corrupt