fix the error frame
implemented second task for homework 4