Added null check, renamed keepAlive property to connectionKeepAlive