fixed nullpointe issues in InstanceBlock