fixed duplicated messages problem