fix insertWithRetry and add groupId to story