fixed script to handle uscan correctly