added 3 times retry for checking server availability
fixed indentation