regeneration bug fix