Fixes the bug of errors of generate part.