Added try-catch in dbinserts