use Object.defineProperty to define attrs