Add record function.