Added a timeout for checking of received msg