diff --git a/lib/simulate.lpc b/lib/simulate.lpc
index d1cb9a33cd845c54c8f69fea566cdc41d645e074..266178226d84693a46d9c73fc02eb8d509115d33 100644
--- a/lib/simulate.lpc
+++ b/lib/simulate.lpc
@@ -324,9 +324,11 @@ function get_function(object o, string a)
 
 string *regexp(string *s, string reg)
 {
+  
   regexp::create(reg);
-  return filter_array(s,match);
+  s=filter_array(s,match);
   regexp::create(); /* Free compiled regexp */
+  return s;
 }
 
 list mklist(mixed *a)