fix bug when return home, does not write close status of current state
add readme
use switch replace radiobutton
refactor code