fix some issues where errors occured