Added exception handling (insert).