added error handlign for gold