Fix bug in task 6c