fixing callback before clean up