older php version fix: don't directly call array value from an object