Moved values array parsing into try-catch