Correctly handle fragments in main activity