add and replace fragment in code