fix bug on old versions of sqlite