added record function