Fix to prevent repeated callback calls