fixed complete function for tasks