fixed php notices and improve displaying group field