added timeout functionality for uart receive operation