Resolved inventory add problem.

We have to use the keyword "instanceof" instead of
checking whether the getClass() objects are instantiated from a type.
The class objects are not relieable.