added check to safe scrpts to ensure data