Added automatic input switch