I think also need to add !empty() check to check the null value.