Adding function to register widgets