fixing timing issue in test script