fix #402 and #403