Fix bugs, creat exception