Added code for fragments