fix issue #56 and #57