add default value to getattr calls to avoid exceptions