reworking to avoid callback errors