fixed bug in init