Fix uncaught reference error