added message reading functionality