Updated class to work correctly with WTS.