Fixing infinite loader when no more events are available