fixed some useless bugs