Add creation of the object in try cath block