set sink first and input streams afterwards