revise the type errors in instance.go file