added empty var check