changed client wait proceedure for messages.