fixed bugs in code that creates BaseFragment array