moving initial directory permission check to parameter check phase
small cleanup to script runner code