Fixed the undefined callback bug.