a little bit better fix for issue #178