handle board number change
fix security problem and refactor