added :key to replace :id if empty