The condition needs to be ran only on allowed_types.
Uploaded correct patch.