Fixed a bug with auto end date