Added ui support, Corrected the invalid input error.