Fixed validation for both environments