change exception type and minor improvements to samples ui