adding code for fragments