Additional validation to avoid JS errors