added correctness check