Fixed bug in catch block for insert