Adding record functionality