Fixed mistake made with IP check