fixed initialization bugs