close resources in attempt to avoid mem leaks