Added support for object for attr function