changed code for error corectn