Add exception handling in caso of unexecpected errors