add db watch and change some fatal error to exception