fix minor erros in the code