close method renamed, class implements AutoCloseable