faster query to check data at startup