update code for message controller