fixing update method, using more sql-alchemic method