modified the IP related functions and variables