fix issues when running on custom classloader