some hacks to get this to work, need to revisit