fixed #136. however i am sure there is a better way to do this.