Optimize sending messages and log

Optimize sending messages and log in rol Teacher and Student