traping exception