now with message dialog instead of println