take in consideratin port number in the redirect done in BaseModel class
fix #705