solve some bugs
update 2013-6-13