fix TypeScript compatibility