Avoid nil while encode() for form