modified generate form