ContextMenu Problem

I have custom context menu for each different class. When i load my UI the custom context menu associated with each object is created as desired. Once i switch views, which results in deleting the current object instances by assigning null and creating the new display list with different object instances, i get only the context menu associated with the document class. i.e wherever i right click i get the context menu associated with the document class.
why is it that the context menus work as per the object properties on initialization and doesnt on rearranging the display list???