fix #33 necessary for other issues mentioned like #18 and #31