Fixed check in sqlite