Fixed an infinite recursive loop