removed bad diagnostic code
fixed error: un-initialised var