fixes bugs

task7, task9