fixing another hasattr call