handling unexpectable indexes