This is pretty gross...but it seems to work...