add check for null fragment