Fixed get client ip function to get correct client IP when behing
proxies