get rid of exceptions

fix #36