fixed bugs with module generation