moved sleep above to sleep if connection is refused as well (pause for server firewall)