Used new carew.terminate event to compile and write less file