better handling when closing resources