fix TypeError