bugfixes, was compeltely broken after refactoring..