Fix memory issue in 4th task.