cleanup; add event handlers to form