Handle NotFoundException safely