better check for nodejs invoke