REF @last_event error with empty table