added seed null check