Improve serial version callback to reduce hanging bug