refactoried to a standard nodejs package
fix debug stack disorder