         let iterator = levelDBIteratorNew(db)
         var stop = false
         #if swift(>=3.0)
-        guard let iteratorPointer = iterator else {
+            guard let iteratorPointer = iterator else {
             print("iterator is nil")
             return
-        }
-        _startIterator(iteratorPointer, backward: backward, prefix: prefix, start: key)
-        #else
-        _startIterator(iterator, backward: backward, prefix: prefix, start: key)
+            }
+            _startIterator(iteratorPointer, backward: backward, prefix: prefix, start: key)
+        #else
+            _startIterator(iterator, backward: backward, prefix: prefix, start: key)
         #endif
         while levelDBIteratorIsValid(iterator) {
             #if swift(>=3.0)

        let iterator = levelDBIteratorNew(db)
        var stop = false
        #if swift(>=3.0)
        guard let iteratorPointer = iterator else {
            print("iterator is nil")
            return
        }
        _startIterator(iteratorPointer, backward: backward, prefix: prefix, start: key)
        #else
        _startIterator(iterator, backward: backward, prefix: prefix, start: key)
        #endif
        while levelDBIteratorIsValid(iterator) {
            #if swift(>=3.0)

        let iterator = levelDBIteratorNew(db)
        var stop = false
        #if swift(>=3.0)
            guard let iteratorPointer = iterator else {
            print("iterator is nil")
            return
            }
            _startIterator(iteratorPointer, backward: backward, prefix: prefix, start: key)
        #else
            _startIterator(iterator, backward: backward, prefix: prefix, start: key)
        #endif
        while levelDBIteratorIsValid(iterator) {
            #if swift(>=3.0)
