refactor code
fix missing library