added code for controller in validating IP