modifying script for unittests