add gateway test
fix slave and exception control