work on #418 and #417