some modifications to make it compatible with my env