Fixed hasattr call