bugfixed resource usage