edited the code for correct a mistake