validate handle before get and set attribute