tried different way to do without buffer