fix resource usage