this seems to need to be done twice for some reason?