Replaced request.remote_addr call with remote_ip