fix cs and bugs