initialize record function