The code you've provided is not sufficient to draw any conclusion, what's wrong. Post the SSCCE

To your current code: What is payroll?
And you can assign values to an array but not the object...