added continue and fixed wrong print output