Fixing callback functions