add repository logic