fix bad check for type.
fix check for payload type.