patches to get it to work