fixes bug where error message was appearing if date form was submitted with no value