bugfix for only call showMessage if it was defined