Fixed hasattr error