BUGFIX: check before shifting classes array in AvailableWidgets

simple check before shifting