fixing a bug in the messagemodel