backport #170 fix