Added clean up to cap file