added wdi function