working event driven mode