Potential resource cleanup problem fixed