bugfixes still a bit buggy