Fixes broken insert to db