Fixed a bug of DB accessing.