Added validations

Shadowing outer local variable - `value`.