modify Arduino code to fix bug