Added messageType parameter to processRemoveMessage