fix flex problem