correct wms function