update extend() for supporting setter and getter