function scan done