Adding some validations to fix broken test