fixes #54 and fixes #51