fixed hasattr issue