removed my duplicated logic from checkIndexedAccess