fix #114 as @xrmx suggested, tested with 1.7