bugfixes to prev commit