fix some todo's bugs