bugfixing and debugging