fixed #67, need to integrate for #56