Fix TypeError