fixed a bug introduced with the upgrade to .net 4.0