add option parsing to slave