Changes to support Sqlite instead Mysql