bugfix
add exception handling