make the script compatible with the fixed pump (events are not ordered)