moved valid card check