fix semantic check for array's index