fix potential bugs
fix potential bugs