 
                     return false
                 else
-                    @cursor.close()
+                    if @cursor?.close?
+                        @cursor.close()
                     return false
             return callback_multiple_queries
         # Function that execute the query

                            return false
                    else #  Else if it's not the last query, we just execute the next query
                        try
                            if @cursor?
                                @cursor.close()

                            @cursor = eval(@queries[@current_query_index])

                window.conn.close()
            catch err
                #console.log 'Could not destroy connection'
            if @cursor?.close?
                @cursor.close()
            clearTimeout @timeout
    
