Bug Fix: Check based on class type instead of empty or exist.