check if class exists before register a widget