add exception checking. prepare more msg type