Code add

add event load, closing and app exit