original version causing errors,so i customized this as a local app