fixing callback function