fix #161

possible fix for #161, needs to be tested