main bugfixes