Creating an add task function