This is really hacky but seems to work.