fix a bug found with realscripts