some bugfixes...still working