only call showMessage if it was defined