add handling network timeout in java