fixed an error in the code