try data.blank? instead please.