add class_exists check also