fixed some remaining bug.