There has got to be a better way to get this working