updated with 'ready' trick to workaround windows scope reset