Moved ip calculation var
Added output redirection for a duplicate message