Fixed the test script and tested it