changes for Ubuntu - read buffer values garbage