gold rises, but ends with a monthly loss