fixed hash token detection, clean up some code and comments, setTimeout for startMedia