fixed error in ternary typeof statment