validation to prevent nil values to be submitted