Added checks for object being enums. if so then service function do not do instanceof checks on enums