CORE-390 Script error appears if close Edit Task modal before it is opened