copied from dev: check payload before sending