fix bugs, need to refactor and fix reset button