changed according to advice from  toastdriven