Fixed bug on index closing