Fix issue with wrong variable regId