Fixed syntax error and calling an undefined function