Fixing function logic on comparation close #1