Updated gen code to try and fix the error it did not work.