dealing with commands and messages