fixed issues with determining users ip address