checked generating expected code. fix #3