minor change to make everything of scanner thread wrapped inside a big
sync block