Fixed deadlock and doesn't change state after scan_stop.