crashing issue fixed, now need to initialise the sqlite db