Task2 bug fixing