BF: use hasattr with providing attr name (Thanks to Timo Schulz)