Thanks that worked.

But now it is giving another error: "Object reference not set to an instance of an object."