Added code to trim fragment