'Chaotic' level statistics and quantum phase transition