eliminate SIGSEGV, now get type error