Made keep-alive support better