Fixed an expensive bug