Added error management and cleaned up UI