this feels really hacky but it seems to work?