bugfixes for api lvl below 12