modified check connection
changed validate token