Fix typeerror