first version( fixed bug)