fix warning by using thread to open scanner