fixing script and log to make sure the log folder is created from the base directory