fixed clear_library bug