this seems to be working fine now