added open/close tasks function