fix genericity
add exit in catch block