replaced pause by callback