fix bug when set amd and async attribute at the same time