     if event == 'deleted'
         if filecache.get(filepath)?
             console.log("nuking", filepath, "from dropbox")
-            db.delete filename, (error) ->
+            db.delete localToDropboxPath(filename), (error) ->
                 throw(error) if error?
                 filecache.rm(filepath)
         else

userToken = process.env.DROPBOX_USER_TOKEN
base = process.env.DROPBOX_LOCAL_DIR
pathPrefix = process.env.DROPBOX_PATH_PREFIX

hash = (data) ->
    shasum = crypto.createHash('sha1')

        #console.log(change)
        if change.wasRemoved
            console.log("nuking file from dropbox change")
            filepath = dropboxToLocalPath(change.path)
            fs.exists filepath, (exists) ->
                if exists
                    fs.stat filepath, (error, stats) ->
