added some bugfixes