read flag for serial now gets updated properly and select no longer blocks