avoid out of memory for malformed scripts