validation tests updatet and added null checks