added consistency checks