did some bugfixing