finally corrected the errors