fix compilation order