Membership plugin downgrading role after subscript expires

Hello, I've been using wordpress roles with the membership plugin but i have a problem when the subscription plan runs out and it defaults to our 'free' plan. The wordpress role does not get assigned correctly when this happens.

Would you be able to advise as to how we can get this working? it's important that users don't remain with premium access when they stop paying.