Prevented empty variables from appearing in the array