there has got to be a better way to deal with this