Changed instanceof check to UserInterface.