add panic and panic test in instance.go and instance_test.go, to be continued