trying to resolve memory usage issue