Added callbacks on generate