relayout and add fw file detect func