Added empty value checking