work on relay class and fix several message issues