applying line by line error check corrections