advance feature

add some exception handling