hasattr() is a nicer way of doing this