Added code from ServiceHost