adapted to the new version of ofEvents