fix #145, #146, #144