fixes to work with later versions of node