finalise compile + fix compile error