fix lead in / lead out bug