logic error on due_date check