not using has_key as it is incompatible with python3