added empty fields check, fixed highlighting