adding random event handling