modified to use create instead of xtype