added check for faulty values