fix TypeError on undefined options