separated errorStatement into a new function, optimized checkNone()