 
     rs = fs.createReadStream '/proc/mounts', flags: 'r'
     rs.setEncoding()
+
     rs.on 'error', (err)->
       console.error error = "Unexpected error : couldn't retrieve mount info: #{err.message}"
       callback error
-    rs.on 'data',(data)->
+
+    rs.on 'data', (data)->
       if data.indexOf(options.mountpoint) isnt -1
         console.log "[OK] #{remotehost} is mounted for user #{username}"
         rs.destroy()


    # fetch user ID for curlftfs command
    @spawnWrapper '/usr/bin/id', ['-u', username], (err,res)=>
      if err?
        log.error error = "[ERROR] Can't find user ID: #{err}"
        callback error
      else
        uid = res.trim()
        log.info "[OK] user ID for user #{username} is #{uid}"
        ftpfsopts = "#{config.ftpfs.opts},uid=#{uid},gid=#{uid},fsname=#{remotehost},user=#{remoteuser}:#{remotepass}"
        @createMountpoint options, (err,res)=>
          if err
            callback err
          else
            @spawnWrapper config.ftpfs.curlftpfs,['-o', ftpfsopts, remotehost, options.mountpoint] , (err, res)=>
              if err?
                log.error error = "[ERROR] couldn't mount remote FTP server #{remotehost}: #{err}"
                callback error
              else
                @remountVE options, (err,res)=>
                  if err?
                    callback err
                  else
                    @updateMountCfg options,(err,res)->
                    callback null,res

  checkMountPoint : (options, callback)->
    #
    # this method checks if remount host mounted (it doesn't check for availability)

          mountpoint: options.mountpoint
        callback null, res
      else
        console.log error = "[ERROR] mount point #{options.mountpoint} is not mounted"
        res =
          mounted: false
          remotehost: remotehost
