adding some validation checking