check if pool is closed when get a resource