Wait time added so that window can be visible