Added Validation and Fixed Conditional