Fixed Bug in which we try to get string when a fragment is not added