added record functionality