Fixed check for SQlite database