Fixes bug where user entering a nonexistent date causes 500 errors