using nan for better compatibility across node versions