Fix the problem with class level variables for collection of complex type

Fix the problem with class level variables for collection of complex types