Adding fragment logic.