corrected bugs in basic message handling