fix bugs on Dao operation