fixed error on page reload
code cleanup and exit on no touch device