Add check for empty events