some minor changes to get it working