Made ui function optional
updated javadoc