Fixed an error in some code