Store menu settings as index to correct memory leak