Added randomize event handler.