Fixed !res.rowCount in tasks.js