fixe bug with home button click, refactoring in progress.
refactoring in progress.