Added check on SERVER_ADDR server variable if it is not set we assume it is localhost