Added getting scratch_dir from app env