Adding the typeerror function