fixed err in database