fixed: incorrect check for has_widget