Fixed syntax error and random event handler