Added initial querying, focusing window too