revert previous fix
add refcounting on the instances