ver3

add exception handle
add log
reformat file