fix source bugs