Issue 159 156

fix issue #156 and #159