cwm scan function update