fixed some error in main lib