implemented listener to notify GUI