fixed ruby script to check against empty list of fields