corrected a bug caused by sqlite