this needs a better solution