fix #330, #327