append. fix some bugs