fix memory leak in get operation

See #2