fix crud function generated not working