Fixed null pointer issue while collection copy