started to merge evalEvent and evalScript into the same function