return if error is found converting payload to bytes