set flag in payload only if a flag is set