fixed issue with while. made skiploc a local var