I wish there was a cleaner way to do this, but I couldn't figure one out. In anycase, it's much better than it was before.