avoid TypeError exception in line 322