some changes to get this to work