Changed method for getting user IP address.