Fixed issue of not handling a null fragment