fix #43 and fix #40