gui: fix optimal bc function