fix basename problem, change the order of the header files in different places