fixed load problems and resource closing