fixed bug where an array of values wasn't getting the correct element