changed semantics to work with scripts