complete task functionality