uncomment try in connect fucntion
comment thread.sleep