I only cast if it is not null