(Bluefox) upgrade adapter function

There is a small error with tmp/adapter deletion. Will fix as next.