add some code for swd3