refactoring code
Fixed library error