Getting a console error for undefined functions