adding record functionality