added hasattr