Fixed some bugs. Close #32

Initiated #35 : finally choose to try catch massiv code and redirect to
logger