Fixed crash when using mailproviders