fix file close on index module test