figured out bug with NULL values