added an gui event handling system