working out errors