restored all the checks in the unit test