Exc handling on jquery