fix template file removal