[task4] - several bugs fixed