Livechat Initial Depatment

How does Omnichannel choose the initial department? On my install every new chat seems to be sent to one department but not the one I wanted.