fixed #41 and #42