fixed order of messaging bug