this replacement stuff here isn't pretty ;) but there is no better way to do this currently, so it's ok