found out gen_array function itself was not executed