diff --git a/Main.hs b/Main.hs
--- a/Main.hs
+++ b/Main.hs
@@ -5,4 +5,4 @@
 import Villefort.Config
 
 main :: IO ()
-main = villefort def 
+main = villefort def
diff --git a/README.md b/README.md
--- a/README.md
+++ b/README.md
@@ -1,9 +1,8 @@
 # Villefort
 Villefort is a time managment system written in Haskell.
 
-## Version 1.2.10
-- Fixed bug in collecting the time spent on project.
-- Removed unecessary print statements.
+## Version 1.2.11
+- Integrated date and day tracking into database to stop file corruption.
 
 [default config](https://github.com/Chrisr850/Villefort/blob/master/src/Villefort/Config.hs)
 
diff --git a/Villefort.cabal b/Villefort.cabal
--- a/Villefort.cabal
+++ b/Villefort.cabal
@@ -1,7 +1,7 @@
 name:                Villefort
-version:             0.1.2.10
-synopsis: Villefort is a task manager and time tracker written in haskell.
-description: Villefort is a browser based time tracker. It offers the creation of weekly and daily triggered tasks. It also offers stats on both daily, weekly and total time spent on tasks.
+version:             0.1.2.11
+synopsis: Villefort is a task manager and time tracker
+description: Villefort is a browser based time tracker built around a sqlite3 database.
 homepage:            https://github.com/Chrisr850/Villefort#readme
 license:             BSD3
 license-file:        LICENSE
@@ -13,9 +13,7 @@
 extra-source-files:  README.md
 cabal-version:       >=1.10
 		    
-data-files:            data/date
-		     , data/todo.db
-                     , data/day
+data-files:            data/todo.db
                      , templates/*.html
                      , templates/*.ts
                      , templates/header
diff --git a/data/date b/data/date
deleted file mode 100644
--- a/data/date
+++ /dev/null
@@ -1,1 +0,0 @@
-2018-01-03
diff --git a/data/day b/data/day
deleted file mode 100644
--- a/data/day
+++ /dev/null
@@ -1,1 +0,0 @@
-3
diff --git a/data/todo.db b/data/todo.db
Binary files a/data/todo.db and b/data/todo.db differ
diff --git a/src/Villefort/Daily.hs b/src/Villefort/Daily.hs
--- a/src/Villefort/Daily.hs
+++ b/src/Villefort/Daily.hs
@@ -36,30 +36,42 @@
   z <- getDate
   return $ snd $mondayStartWeek z
 
+
+writeDate :: (MonadReader VConfig m, MonadIO m) => m ()
+writeDate = do
+  date <- liftIO $ show <$> getDate
+  execQuery ("update dates set  date = ? where type = 'date';") [date]
+
+readDate :: (MonadReader VConfig m, MonadIO m) => m D
+readDate = do
+  rawDate <- makeQuery "select date from dates where type = 'date';"
+  return $ unpackStringToDate $ head $ head $ rawDate
+
+{-
 writeDate :: IO ()
 writeDate = do
   date <-  show <$> getDate
   datePath <- getDataFileName "data/date"
   writeFile datePath date
 
+
 readDate :: IO D
 readDate = do
   datePath <- getDataFileName "data/date"
   rawDate <-  S.readFile datePath
   let date = unpackStringToDate rawDate
   return date
+-}
 
-writeDay :: IO ()
+writeDay :: (MonadReader VConfig m, MonadIO m) => m ()
 writeDay = do
-  newDay <- show <$> getDay
-  datePath <- getDataFileName "data/day"
-  writeFile datePath newDay
-
-readDay :: IO Int
+  newDay <- liftIO $ show <$> getDay
+  execQuery ("update dates set  date = ? where type = 'day';") [newDay]
+  
+readDay :: (MonadReader VConfig m, MonadIO m) => m Int
 readDay = do
-  datePath <- getDataFileName "data/day"
-  rawDay <- S.readFile datePath
-  let int = read rawDay :: Int
+  rawDay <- makeQuery "select date from dates where type = 'day';"
+  let int = read (head $ head $ rawDay) :: Int
   return int
   
 checkDay :: D -> D ->Bool
@@ -120,14 +132,14 @@
 --man :: IO ()
 man :: VConfig -> IO ()
 man conf = do
-  oldDate <- readDate
+  oldDate <- runReaderT readDate conf
   currentDate <- getDateD
-  oldDay <- readDay
+  oldDay <- runReaderT readDay conf
   currentDay <- getDay
   runWeekly conf oldDay currentDay
   runDaily conf oldDate currentDate
-  writeDate
-  writeDay
+  runReaderT writeDate conf
+  runReaderT writeDay conf
   threadDelay 18000000
   
 dailyCheck :: VConfig -> IO b
diff --git a/src/Villefort/Database.hs b/src/Villefort/Database.hs
--- a/src/Villefort/Database.hs
+++ b/src/Villefort/Database.hs
@@ -107,5 +107,5 @@
 --getSum :: IO (Maybe [String])
 
 
-clean = replace "'" "''"
+clean = id --replace "'" "''"
  
diff --git a/src/Villefort/Log.hs b/src/Villefort/Log.hs
--- a/src/Villefort/Log.hs
+++ b/src/Villefort/Log.hs
@@ -35,7 +35,7 @@
 
 -- | creates the github like graph from database
 
-makeGithub ::(MonadReader VConfig m, MonadIO m) =>  String ->  m Subject
+--makeGithub ::(MonadReader VConfig m, MonadIO m) =>  String ->  m Subject
 makeGithub subject = do
   z <-   makeQuery ("select substr(Due,1,10) from todo where subject = '" ++ (clean subject) ++ "' and state = 0") 
   color <- liftIO $  getColor 
diff --git a/src/Villefort/Server.hs b/src/Villefort/Server.hs
--- a/src/Villefort/Server.hs
+++ b/src/Villefort/Server.hs
@@ -61,7 +61,6 @@
 checkCustomBuild = do
   dir <- getAppUserDataDirectory "villefort"
   let path = dir ++ "/villefort"
-  putStrLn path
   isBuild <- doesFileExist path
   dataDir <- getDataDir
   if isBuild
@@ -89,9 +88,11 @@
     post "/update" $ do
       rawHtml <- body
       let da   = Data.List.Split.splitOn "&" (show rawHtml)
+      do liftIO $ print $ show da
       let rawid = Data.List.Split.splitOn "=" $  (Prelude.init (da !! 1))
       let sqlId   = read (rawid!! 1) :: Int
       let rawtime = Data.List.Split.splitOn "=" $ (da !! 0)
+      do liftIO $ print rawtime
       let insertTime = read (rawtime !! 1) :: Int
       liftIO $ runReaderT (updateTodos sqlId insertTime) conf
       redirect "/"
@@ -99,6 +100,7 @@
     post "/add" $ do
       rawBody <-body
       let parse = Data.List.Split.splitOn "&" (show rawBody)
+      do liftIO $ print parse
       -- !@#$%^&*()_+
       let rep  =  replace "+" " " . replace "%21" "!" . replace "%40" "@" . replace "%23" "#" . replace "%24" "$" . replace "%25" "%" . replace "%5E" "^" . replace "%26" "&" . replace "%28" "(" . replace "%29" ")" . replace "%2B" "+"
       let summary = rep $ getIndex parse 0
diff --git a/src/Villefort/Todo.hs b/src/Villefort/Todo.hs
--- a/src/Villefort/Todo.hs
+++ b/src/Villefort/Todo.hs
@@ -55,7 +55,9 @@
   x <- makeQuery' "select id, Title, Description, Due, Subject, pred from todo where state=1 group by id order by Due"
   let ids =  map head x
   times <- mapM getTime ids
+  liftIO $ print $ length times
   let halfRows = (map toRow x) :: [Int -> Double -> Row]
+  liftIO $ print $ length halfRows
   let z =  apply halfRows times
   return $ apply z [0,0 .. 1]
 -- | applies a list of functions to a list of values
@@ -100,6 +102,7 @@
             title row,
             description row,
             show $ time row,
+            show $ Villefort.Todo.pred row,
             "/delete",
             show $ rid row
            ]
diff --git a/src/Villefort/Weekly.hs b/src/Villefort/Weekly.hs
--- a/src/Villefort/Weekly.hs
+++ b/src/Villefort/Weekly.hs
@@ -1,5 +1,5 @@
 {-# LANGUAGE FlexibleContexts #-}
-module Villefort.Weekly  where
+module Villefort.Weekly (weeklyStats) where
 
 import Control.Monad.Reader
 import Villefort.Definitions
@@ -38,13 +38,13 @@
   return $ addDays (-currentDay) today
 
 fromZonedTimeToDay :: String -> Day
-fromZonedTimeToDay x = fromGregorian (read (split !! 0) :: Integer) (read (split !! 1) :: Int) (read (take 2 (split !! 2)) :: Int)
+fromZonedTimeToDay x = fromGregorian ( y split 0) (md split 1) (md split 2)
   where split = S.splitOn "-" x
+        md splits x = read ( splits !! x) :: Int
+        y     splits x = read ( splits !! x ) :: Integer
+
 getDate :: IO Day
-getDate = do
-  a <- getZonedTime
-  let z = show a
-  return $ fromZonedTimeToDay z 
+getDate = fromZonedTimeToDay <$> show <$> getZonedTime
 
 getDay :: IO Int
 getDay = do
diff --git a/templates/modal.ts b/templates/modal.ts
--- a/templates/modal.ts
+++ b/templates/modal.ts
@@ -15,6 +15,7 @@
           <p> } </p>
 	  
 	  <p> Total minutes spent working on Project } </p>
+	  <p> Predicted time } </p>
         </div>
         <div class="modal-footer">
 	<form class="pull-left" action="}" method="post" class="add-entry">
