fixed bug: wrong variable init