making an easier function to register the controls