fixed bug where too big input caused a stack overflow with containsId