bugfix for monkey patch
add exception handle