diff --git a/src/USER-MISC/temper_npt.cpp b/src/USER-MISC/temper_npt.cpp
index 572a52b1a921c347d4d70469f9664d7831ed404f..e405377d794a02a0ad1133199ab633ddf913bf95 100644
--- a/src/USER-MISC/temper_npt.cpp
+++ b/src/USER-MISC/temper_npt.cpp
@@ -101,9 +101,9 @@ void TemperNPT::command(int narg, char **arg)
   // change the volume. This currently only applies to fix npt and
   // fix rigid/npt variants
 
-  if ((strncmp(modify->fix[whichfix]->style,"npt",3) == 0)
-      || (strncmp(modify->fix[whichfix]->style,"rigid/npt",9) == 0))
-    error->universe_all(FLERR,"Tempering temperature fix is not supported");
+  if ((strncmp(modify->fix[whichfix]->style,"npt",3) != 0)
+      && (strncmp(modify->fix[whichfix]->style,"rigid/npt",9) != 0))
+    error->universe_all(FLERR,"Tempering temperature and pressure fix is not supported");
 
   // setup for long tempering run