Setting up controller