fix issues in generation