erlang generator modified : can use getter and setter