trying to fix the TypeError