fix messages bugs