handle preflight