removed extraneous 'when'