added changes from home: https://github.com/t-weber/takin2/commit/5161cdbe7f57b448a90e8528027cae0f4f9ff8de