fixed bug properly