fixing compile bugs