added slave support.