send header and message together to avoid errors when sending two messages immediately