Added validateInsideIP function