fix bug + working sql lite