[OOP] fixed bug in task 4 from Project 2

All tested and working