revert #224 and implement a better fix