Fix for db insert method