Fix a bug that update attributes failed for non-string attributes