reorganised library files
fix bug on library mode