using hasattr on f