This is a terrible hack, I'm quite sure there's a better way to do this.