close resource