Fixed issue where array was being appended with name instead of return of ternary operation