fix certain bugs