Don't forget to unlock instance_mutex in the error path.