array and object must be passed by reference