trying to fix buffered input